<!DOCTYPE html>
 <%@ page language="java" contentType="text/html; charset=utf-8" %>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
	<head>
		<title>LaSeC</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="/LaSeC/static/css/style.css" rel="stylesheet" type="text/css" />
		<script language = "javascript" src = "/LaSeC/static/js/fjs.js"></script>
		<script language = "javascript" src = "/LaSeC/static/js/lasec.js"></script>
		<script>
		function login() {
			FB.api('/me', function(response) {
				document.getElementById('login').style.display = "block";
				document.getElementById('login').innerHTML = "<p>Hello!</p><p>" + response.name + "</p>";
				document.getElementById('login').innerHTML += '<p><a href ="/LaSeC/Recommend?uid=' + FB.getSession().uid + '">Recommend me a movie!</a></p>';
				document.getElementById('login').innerHTML += '<fb:profile-pic uid="' + response.id	+ '" linked="false" size="normal" width="170"></fb:profile-pic>';
				FB.XFBML.parse(document.getElementById('login'));
			});
		}
		
		function logout() {
			document.getElementById('login').style.display = "none";
		}
		
		function recommend() {
			var param = "uid=" + encodeURIComponent(FB.getSession().uid);
			location.href = "/LaSeC/Recommend?" + param;
		}
		</script>
	</head>
	<body>
	<div id="wrapper">
		<div id="inner">
			<div id="header">
				<a href = "/LaSeC"><img src="/LaSeC/Images/header.jpg" width="744" height="145" alt="main_logo" /></a>
			</div><!-- end of header -->
		<div id="fb-root"></div>
		<dl id="browse">
			<dt>Login</dt>
				<dd class="formBox">
					<div id="login" style="display: none"></div>
					<div id="name"></div>
					<fb:login-button autologoutlink="true" perms="user_birthday, user_hometown, read_friendlists"></fb:login-button>
				</dd>
				
							
			<dt>Search Your Favorite Movie</dt>
				<dd class="formBox">
					<form id = "searchForm" name = "seachForm" method = "get" action = "/LaSeC/Search" onsubmit ="return checkSearchQuery(this)">
						<div><input name="query" type="text" value="" class="text" /></div>
						<div class=softright><input type="submit" name = "submit" value = "Search" /></div>
					</form>

				</dd>
		</dl>
	